
(function() {
    var User = function() {
        this._bindProperties();
    };

    User.prototype._bindProperties = function() {
        Object.defineProperties(this, {
            "valid": {
                get: function() {
                    return this.valid;
                },
                set: function(value) {
                    this.valid = value;
                }
            },
            "account": {
                get: function() {
                    return this.account || "";
                },
                set: function(value) {
                    this.account = value;
                }
            },
            "userId": {
                get: function() {
                    return this.UserID || 0;
                },
                set: function(value) {
                    this.UserID = value;
                }
            },
            "headId": {
                get: function() {
                    return this.RoleID || 0;
                },
                set: function(value) {
                    this.RoleID = value;
                }
            },
            "nick": {
                get: function() {
                    return this.Nick || "";
                },
                set: function(value) {
                    this.Nick = value;
                }
            },
            "sex": {
                get: function() {
                    return this.Sex || 0;
                },
                set: function(value) {
                    this.Sex = value;
                }                
            },
            "birthArea": {
                get: function() {
                    return this.BirthArea || 0;
                },
                set: function(value) {
                    this.BirthArea = value;
                }
            }
        });

        Object.defineProperties(this, {
            "power": {
                get: function() {
                    return this.Power || 0;
                },
                set: function(value) {
                    this.Power = value;
                }
            },
            "wit": {
                get: function() {
                    return this.Wit || 0;
                },
                set: function(value) {
                    this.Wit = value;
                }
            },

            "strength": {
                get: function() {
                    return this.Strength || 0;
                },
                set: function(value) {
                    this.Strength = value;
                }
            },
            "luck": {
                get: function() {
                    return this.Luck || 0;
                },
                set: function(value) {
                    this.Luck = value;
                }
            },
            "itemList": {
                get: function() {
                    return this.itemList || {};
                },
                set: function(value) {
                    this.itemList = value;
                }
            },
            "voteState": {
                get: function() {
                    return this.voteState || [];
                },
                get: function(value) {
                    this.voteState = value; 
                }
            }
        });

        Object.defineProperties(this, {
            "itemList": {
                get: function() {
                    return this.itemList || [];
                },
                set: function(value) {
                    this.itemList = value;
                }
            }
        });
    };

    module.exports = User;
})();